#include <my_header.h>

/* Usage: ./4_popen2.c */
int main(int argc, char *argv[]){                                  

    char buf[1024];
    // 读取4_print_str的标准输出
    FILE *pipe = popen("./4_print_str", "r");
    ERROR_CHECK(pipe, NULL, "popen");

    fread(buf, 1, sizeof(buf), pipe);

    printf("4_print_str : \n%s", buf);
    pclose(pipe);
    return 0;
}


